//import cn.hutool.http.HttpResponse;
//import cn.hutool.http.HttpUtil;
//import cn.hutool.http.Method;
//import cn.hutool.json.JSONObject;
//import cn.hutool.json.JSONUtil;
//
//import java.util.HashMap;
//import java.util.Map;
//
//public class WeChatDemo {
//    public static void main(String[] args) {
//        Map paramMap = new HashMap<>();
//        paramMap.put("appid","wx2c43f690092d3bc7");
//        paramMap.put("secret","aa8e77fedf893f17b0c0b0fe4cfb7d62");
//        paramMap.put("js_code","0e3ypf10012haV1Rpx000gCwGy1ypf1V");
//        paramMap.put("grant_type","authorization_cod");
//
//        HttpResponse httpResponse = HttpUtil.createRequest(Method.GET, "https://api.weixin.qq.com/sns/oauth2/access_token")
//                .form(paramMap).execute();
//        if (httpResponse.isOk()){
//            String body = httpResponse.body();
//            JSONObject jsonObject = JSONUtil.parseObj(body);
//            String openid = jsonObject.getStr("openid");
//            System.out.println(openid);
//        }
//    }
//}
